package modules

import "github.com/fogleman/gg"

type Lines struct {
	StartX float64 `json:"startX"`
	StartY float64 `json:"startY"`
	EndX   float64 `json:"endX"`
	EndY   float64 `json:"endY"`
	Width  float64 `json:"width"`
	Color  string  `json:"color"`
}

// 划线
func drawLines(poster *Poster, canvas *gg.Context) {
	for _, line := range poster.Lines {
		canvas.SetLineWidth(line.Width)
		canvas.SetHexColor(line.Color)
		canvas.DrawLine(line.StartX, line.StartY, line.EndX, line.EndY)
		canvas.Stroke()
	}
}
